﻿
@*<div class="easyui-layout" data-options="fit:true" style="margin:40px;">
        <div data-options="region:'north',height:'20%'">
            123
        </div>
        <div data-options="region:'west',width:'20%'">
            123
        </div>
        <div data-options="region:'center'" style="padding:25px;">
            <input id="t1" name="t1" type="text" class="easyui-combobox" />
            <br /><br />
            <input id="t2" name="t2" type="text" class="easyui-textbox" data-options="prompt:'请输入'" />
            <br /><br />
            <button id="btn1" name="btn1">保存</button>
        </div>
    </div>*@

@*<script>
        $(function () {
            $("#t1").combobox("loadData", [{ text: "请选择", value: "" }, { text: "A", value: 0 }, { text: "B", value: 1 }, { text: "C", value: 2 }]);

            $("input[name='cbx']").click(function () {

            });

            $("#btn1").click(function () {
                var r1 = $("#t2").textbox("getValue");
                var r2 = $("#t2").textbox("getText");

                alert("getValue:" + r1); alert("getText:" + r2);
            });
        });
    </script>*@

@*<div class="easyui-panel" data-options="fit:true" style="padding:20px;">

    </div>*@

@*@Html.Action("CurrentSource", "Base")*@

@*@{
        Layout = "~/Views/Shared/_LayoutSpeical.cshtml";
    }

    <div class="easyui-panel" data-options="fit:true">
        <table id="dg1"></table>
    </div>


    <script>
        $(function () {

            var lastRow = [];

            var getColumns = function () {
                var result = [];

                var normal = [
                    { field: 'AreaName', title: '姓名', width: 60 },
                    {
                        field: 'Sex1', title: '性别', width: 60
                    }
                ];
                result.push(normal);

                return result;
            };
            var options = {
                title: "列表",
                idField: "ID",
                rownumbers: true,
                remoteSort: false,
                fit: true,
                border: false,
                singleSelect: true,
                columns: getColumns(),
                method: "get",
                url: "/Jsons/datagrid/datagrid-common-data.json",
                onSelect: function (index, row) {
                    lastRow.push(row);
                    console.log("触发onSelect，此时 lastRow 长度为：" + lastRow.length);

                },
                onUnselectAll: function (rows) {
                    lastRow = [];
                    console.log("触发onUnselectAll，lastRow 已清空");

                },
                onLoadSuccess: function (data) {
                    $(this).datagrid("selectRow", 0);
                    $(this).datagrid("selectRecord", 4);
                    console.log("在onLoadSuccess里手动触发onSelect，此时 lastRow 长度为：" + lastRow.length);
                },
                toolbar: [
                    {
                        text: "检测 lastRow 长度",
                        handler: function () {
                            //console.log(lastRow.length);
                            //var rows = $("#dg1").datagrid("getRows");
                            //console.log("隐藏前");
                            //console.log(JSON.stringify(rows));
                            //$("#dg1").datagrid("hideColumn", "Sex1");
                            //console.log("隐藏后");
                            //console.log(JSON.stringify($("#dg1").datagrid("getRows")));
                        }
                    }
                ],
                pagination: true
            };

            $("#dg1").datagrid(options);
        });
    </script>*@



@*<div class="easyui-tabs" data-options="fit:true,border:false">
        <div data-options="title:'1111'">
            <div class="easyui-panel" data-options="title:'p1'" style="border:1px solid red;height:33%;width:100%;">
                123
            </div>
            <div class="easyui-panel" data-options="title:'p2'" style="border:1px solid red;height:33%;width:100%;">
                456
            </div>
            <div class="easyui-panel" data-options="title:'p3'" style="border:1px solid red;height:34%;width:100%;">
                789
            </div>
        </div>
        <div data-options="title:'2222'">

        </div>
    </div>*@


@*<link href="~/Scripts/jquery-plugins/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-plugins/My97DatePicker/WdatePicker.js"></script>
    <script src="~/Scripts/jquery-easyui-extensions/my97/jeasyui.extensions.my97.js"></script>
    <div class="easyui-panel" data-options="fit:true,border:false" style="padding:20px;">
        <input class="easyui-my97" data-options="value:'2012-10-12'" />
        <br /><br />
        <input class="Wdate" type="text" value="2012-10-12" onclick="WdatePicker()" />
    </div>*@

@*<script src="~/Scripts/jquery-easyui-extensions/datagrid/jeasyui.extensions.datagrid.autoMerge.js"></script>
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'west',title:'西部',border:false,split:true" style="width:260px;border-right-width:1px;">
        </div>
        <div data-options="region:'center',title:'中部',border:false" style="border-left-width:1px;">
            <table id="dg"></table>
        </div>
    </div>

    <script>
        $(function () {
            var getFrozenColumns = function () {
                var result = [];

                var c1 = [];
                c1.push({ field: 'ID', title: '主键', width: 100 });
                c1.push({ field: 'AreaName', title: '地区', width: 150 });
                c1.push({ field: 'Sex1', title: '男', width: 90 });
                c1.push({ field: 'Sex2', title: '女', width: 90 });

                result.push(c1);

                return result;
            };
            var getColumns = function () {
                var result = [];

                var normal = [
                    { field: 'TS1', title: '测试1', width: 60 },
                    { field: 'TS2', title: '测试2', width: 60 }
                ];
                result.push(normal);

                return result;
            };

            var options = {
                idField: "ID",
                rownumbers: true,
                fit: true,
                border: false,
                singleSelect: true,
                toolbar: [
                    {
                        text: "合并", iconCls: "icon-add", handler: function () {
                            $("#dg").datagrid("autoMergeCells", ['Sex2']);
                        }
                    }
                ],
                frozenColumns: getFrozenColumns(),
                columns: getColumns(),
                method: "get",
                url: "/Jsons/datagrid/datagrid-common-data.json"
            };

            $("#dg").datagrid(options);
        });
    </script>*@